package Demo6;

public class test {
    public static void main(String[] args) {
        Rect rect = new Rect();
        Cycle cycle =new Cycle();
        Flower flower =new Flower();
        Shape[] shapes = {cycle,rect,flower,rect,flower,cycle};
        for (Shape shape :shapes){
            shape.draw();
        }
    }
    public static void main2(String[] args) {
        Rect rect = new Rect();
        Cycle cycle =new Cycle();
        Flower flower =new Flower();
        String[] shapes ={"cycle","rect","flower","cycle","rect"};
        for (String s:shapes){
            if(s.equals("cycle")){
                cycle.draw();
            }else if(s.equals("rect")){
                rect.draw();
            }else{
                flower.draw();
            }
        }
    }
    public static void drawMpp(Shape shape){
        shape.draw();
    }
    public static void main1(String[] args) {
        Rect rect = new Rect();
        Cycle cycle =new Cycle();
        Flower flower =new Flower();
        drawMpp(rect);
        drawMpp(cycle);
        drawMpp(flower);
    }
}
